package cn.mrcode.fd.blog.task.quartz;

import cn.mrcode.fd.blog.buutil.BeanUtil;
import cn.mrcode.fd.blog.cache.service.IArticleCache;
import cn.mrcode.fd.blog.cache.service.IUserCache;
import cn.mrcode.fd.blog.services.IBlogConfigService;

/**
 * 定时任务
 * @author : zhuqiang
 * @version : V1.0
 * @date : 2016/2/28 12:36
 */
public class QuartzTask {
    /**
     * 每日清理
     */
    public void clearVisitsNum(){
        IBlogConfigService iBlogConfigService = BeanUtil.beans.getBean(IBlogConfigService.class);
        iBlogConfigService.updateBatchResetTodayVisitsNum();

        IUserCache iUserCache = BeanUtil.beans.getBean(IUserCache.class);
        iUserCache.clearTodayTop();
    }
    // 每周清理
    public void weekClear(){
        IArticleCache iArticleCache = BeanUtil.beans.getBean(IArticleCache.class);
        iArticleCache.clearWeekHotTop();
        iArticleCache.clearWeekNewests();
    }
}
